.class public Lkairo/android/c/e;
.super Ljava/lang/Object;


# static fields
.field private static b:[Ljava/lang/String;


# instance fields
.field private a:I


# direct methods
.method private constructor <init>(I)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput p1, p0, Lkairo/android/c/e;->a:I

    return-void
.end method

.method private static a(Ljava/lang/String;[B)V
    .locals 3

    const/4 v2, 0x0

    invoke-static {}, Lkairo/android/ui/IApplication;->a()Lkairo/android/ui/IApplication;

    move-result-object v0

    if-nez p1, :cond_0

    new-array p1, v2, [B

    :cond_0
    invoke-static {p1}, Lkairo/android/c/f;->a([B)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v2}, Lkairo/android/ui/IApplication;->getPreferences(I)Landroid/content/SharedPreferences;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0, p0, v1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    move-result v0

    if-nez v0, :cond_1

    new-instance v0, Ljava/io/IOException;

    const-string v1, "commit failed"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    :cond_1
    return-void
.end method

.method public static a([Ljava/lang/String;)V
    .locals 0

    sput-object p0, Lkairo/android/c/e;->b:[Ljava/lang/String;

    return-void
.end method

.method public static a()Z
    .locals 7

    const/4 v0, 0x0

    invoke-static {}, Lkairo/android/ui/IApplication;->a()Lkairo/android/ui/IApplication;

    move-result-object v2

    invoke-virtual {v2, v0}, Lkairo/android/ui/IApplication;->getPreferences(I)Landroid/content/SharedPreferences;

    move-result-object v1

    invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v3

    invoke-virtual {v2}, Lkairo/android/ui/IApplication;->fileList()[Ljava/lang/String;

    move-result-object v4

    :goto_0
    array-length v1, v4

    if-ge v0, v1, :cond_3

    aget-object v5, v4, v0

    const/4 v1, 0x0

    :try_start_0
    invoke-virtual {v2, v5}, Lkairo/android/ui/IApplication;->openFileInput(Ljava/lang/String;)Ljava/io/FileInputStream;

    move-result-object v1

    invoke-virtual {v1}, Ljava/io/FileInputStream;->available()I

    move-result v6

    new-array v6, v6, [B

    invoke-virtual {v1, v6}, Ljava/io/FileInputStream;->read([B)I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-eqz v1, :cond_0

    invoke-virtual {v1}, Ljava/io/FileInputStream;->close()V

    :cond_0
    invoke-static {v6}, Lkairo/android/c/f;->a([B)Ljava/lang/String;

    move-result-object v1

    invoke-interface {v3, v5, v1}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    invoke-interface {v3}, Landroid/content/SharedPreferences$Editor;->commit()Z

    move-result v1

    if-nez v1, :cond_2

    new-instance v0, Ljava/io/IOException;

    const-string v1, "commit failed"

    invoke-direct {v0, v1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v0

    :catchall_0
    move-exception v0

    if-eqz v1, :cond_1

    invoke-virtual {v1}, Ljava/io/FileInputStream;->close()V

    :cond_1
    throw v0

    :cond_2
    invoke-virtual {v2, v5}, Lkairo/android/ui/IApplication;->deleteFile(Ljava/lang/String;)Z

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_3
    const/4 v0, 0x1

    return v0
.end method

.method public static a(II)[B
    .locals 1

    :try_start_0
    invoke-static {p0}, Lkairo/android/c/e;->c(I)Lkairo/android/c/e;

    move-result-object v0

    invoke-virtual {v0, p1}, Lkairo/android/c/e;->a(I)[B
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result-object v0

    return-object v0

    :catchall_0
    move-exception v0

    throw v0
.end method

.method private static b(II)Ljava/lang/String;
    .locals 4

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-static {p1}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x3

    const/16 v3, 0x30

    invoke-static {v1, v2, v3}, Lkairo/android/i/m;->a(Ljava/lang/String;IC)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public static b()V
    .locals 0

    invoke-static {}, Lkairo/android/c/e;->a()Z

    return-void
.end method

.method public static b(I[B)V
    .locals 1

    const/4 v0, 0x0

    :try_start_0
    invoke-static {v0}, Lkairo/android/c/e;->c(I)Lkairo/android/c/e;

    move-result-object v0

    invoke-virtual {v0, p0, p1}, Lkairo/android/c/e;->a(I[B)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    return-void

    :catchall_0
    move-exception v0

    throw v0
.end method

.method public static c(I)Lkairo/android/c/e;
    .locals 1

    new-instance v0, Lkairo/android/c/e;

    invoke-direct {v0, p0}, Lkairo/android/c/e;-><init>(I)V

    return-object v0
.end method

.method public static e()V
    .locals 0

    return-void
.end method


# virtual methods
.method public final a(I[B)V
    .locals 2

    const/4 v0, 0x1

    new-array v0, v0, [[B

    const/4 v1, 0x0

    aput-object p2, v0, v1

    invoke-virtual {p0, p1, v0}, Lkairo/android/c/e;->a(I[[B)V

    return-void
.end method

.method public final a(I[[B)V
    .locals 8

    const/16 v7, 0x8

    const/4 v6, 0x0

    iget v0, p0, Lkairo/android/c/e;->a:I

    const/4 v1, 0x1

    if-ne v0, v1, :cond_0

    sget-object v0, Lkairo/android/c/e;->b:[Ljava/lang/String;

    if-eqz v0, :cond_0

    :goto_0
    return-void

    :cond_0
    invoke-static {}, Lkairo/android/ui/IApplication;->a()Lkairo/android/ui/IApplication;

    iget v0, p0, Lkairo/android/c/e;->a:I

    invoke-static {v0, p1}, Lkairo/android/c/e;->b(II)Ljava/lang/String;

    move-result-object v0

    aget-object v1, p2, v6

    const/4 v2, 0x0

    aput-object v2, p2, v6

    array-length v2, v1

    add-int/lit8 v2, v2, 0x8

    new-array v2, v2, [B

    invoke-static {v1}, Lkairo/android/i/b;->a([B)J

    move-result-wide v3

    new-array v5, v7, [B

    invoke-static {v3, v4, v5}, Lkairo/android/i/c;->a(J[B)[B

    move-result-object v3

    invoke-static {v3, v6, v2, v6, v7}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    array-length v3, v1

    invoke-static {v1, v6, v2, v7, v3}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    invoke-static {v2}, Lkairo/android/i/d;->b([B)V

    invoke-static {v0, v2}, Lkairo/android/c/e;->a(Ljava/lang/String;[B)V

    goto :goto_0
.end method

.method public final a(I)[B
    .locals 7

    const/4 v0, 0x0

    iget v1, p0, Lkairo/android/c/e;->a:I

    const/4 v2, 0x1

    if-ne v1, v2, :cond_2

    sget-object v1, Lkairo/android/c/e;->b:[Ljava/lang/String;

    if-eqz v1, :cond_2

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v1, Lkairo/android/c/e;->b:[Ljava/lang/String;

    aget-object v1, v1, p1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    sget-object v0, Lkairo/android/c/e;->b:[Ljava/lang/String;

    aget-object v0, v0, p1

    const-string v2, ".dat"

    invoke-virtual {v0, v2}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    const-string v0, ""

    :goto_0
    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lkairo/android/c/g;->b(Ljava/lang/String;)[B

    move-result-object v0

    :cond_0
    :goto_1
    return-object v0

    :cond_1
    const-string v0, ".dat"

    goto :goto_0

    :cond_2
    invoke-static {}, Lkairo/android/ui/IApplication;->a()Lkairo/android/ui/IApplication;

    iget v1, p0, Lkairo/android/c/e;->a:I

    invoke-static {v1, p1}, Lkairo/android/c/e;->b(II)Ljava/lang/String;

    move-result-object v1

    :try_start_0
    invoke-static {}, Lkairo/android/ui/IApplication;->a()Lkairo/android/ui/IApplication;

    move-result-object v2

    const/4 v3, 0x0

    invoke-virtual {v2, v3}, Lkairo/android/ui/IApplication;->getPreferences(I)Landroid/content/SharedPreferences;

    move-result-object v2

    const/4 v3, 0x0

    invoke-interface {v2, v1, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    if-nez v1, :cond_4

    :goto_2
    if-nez v0, :cond_3

    const/4 v0, 0x0

    new-array v0, v0, [B

    :cond_3
    array-length v1, v0

    if-eqz v1, :cond_0

    invoke-static {v0}, Lkairo/android/i/d;->c([B)V

    invoke-static {v0}, Lkairo/android/i/c;->a([B)J

    move-result-wide v2

    array-length v1, v0

    add-int/lit8 v1, v1, -0x8

    new-array v1, v1, [B

    const/16 v4, 0x8

    const/4 v5, 0x0

    array-length v6, v1

    invoke-static {v0, v4, v1, v5, v6}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V


    invoke-static {v1}, Lkairo/android/i/b;->a([B)J

    #base64-> normal string decode result
    #invoke-static {v1}, Lcom/liyong/test/Util;->LogByteArr([B)V


    move-result-wide v4

    cmp-long v0, v4, v2

    if-eqz v0, :cond_5

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v4, "data="

    invoke-direct {v0, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    array-length v1, v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ",crc="

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lkairo/android/i/i;->a(Ljava/lang/String;)Ljava/lang/String;

    new-instance v0, Lkairo/android/i/f;

    invoke-direct {v0}, Lkairo/android/i/f;-><init>()V

    throw v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    :catchall_0
    move-exception v0

    throw v0

    :cond_4
    :try_start_1
    invoke-static {v1}, Lkairo/android/c/f;->a(Ljava/lang/String;)[B
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    move-result-object v0

    goto :goto_2

    :cond_5
    move-object v0, v1

    goto :goto_1
.end method

.method public final b(I)I
    .locals 3

    const/4 v0, 0x0

    iget v1, p0, Lkairo/android/c/e;->a:I

    const/4 v2, 0x1

    if-ne v1, v2, :cond_1

    sget-object v1, Lkairo/android/c/e;->b:[Ljava/lang/String;

    if-eqz v1, :cond_1

    :cond_0
    :goto_0
    return v0

    :cond_1
    invoke-virtual {p0, p1}, Lkairo/android/c/e;->a(I)[B

    move-result-object v1

    if-eqz v1, :cond_0

    array-length v0, v1

    goto :goto_0
.end method

.method public final c()I
    .locals 3

    iget v0, p0, Lkairo/android/c/e;->a:I

    const/4 v1, 0x1

    if-ne v0, v1, :cond_0

    sget-object v0, Lkairo/android/c/e;->b:[Ljava/lang/String;

    if-eqz v0, :cond_0

    const/4 v0, -0x1

    :goto_0
    return v0

    :cond_0
    invoke-static {}, Lkairo/android/ui/IApplication;->a()Lkairo/android/ui/IApplication;

    invoke-virtual {p0}, Lkairo/android/c/e;->d()I

    move-result v0

    iget v1, p0, Lkairo/android/c/e;->a:I

    invoke-static {v1, v0}, Lkairo/android/c/e;->b(II)Ljava/lang/String;

    move-result-object v1

    const/4 v2, 0x0

    new-array v2, v2, [B

    invoke-static {v1, v2}, Lkairo/android/c/e;->a(Ljava/lang/String;[B)V

    goto :goto_0
.end method

.method public final d()I
    .locals 6

    const/4 v2, 0x0

    iget v0, p0, Lkairo/android/c/e;->a:I

    const/4 v1, 0x1

    if-ne v0, v1, :cond_0

    sget-object v0, Lkairo/android/c/e;->b:[Ljava/lang/String;

    if-eqz v0, :cond_0

    :goto_0
    return v2

    :cond_0
    invoke-static {}, Lkairo/android/ui/IApplication;->a()Lkairo/android/ui/IApplication;

    move-result-object v0

    invoke-virtual {v0, v2}, Lkairo/android/ui/IApplication;->getPreferences(I)Landroid/content/SharedPreferences;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences;->getAll()Ljava/util/Map;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Map;->size()I

    move-result v1

    if-lez v1, :cond_2

    invoke-interface {v0}, Ljava/util/Map;->keySet()Ljava/util/Set;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v3

    move v1, v2

    :cond_1
    :goto_1
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_3

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-virtual {v0, v2}, Ljava/lang/String;->charAt(I)C

    move-result v4

    iget v5, p0, Lkairo/android/c/e;->a:I

    add-int/lit8 v5, v5, 0x30

    if-ne v4, v5, :cond_1

    invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    rem-int/lit16 v0, v0, 0x3e8

    if-gt v1, v0, :cond_4

    add-int/lit8 v0, v0, 0x1

    :goto_2
    move v1, v0

    goto :goto_1

    :cond_2
    move v1, v2

    :cond_3
    move v2, v1

    goto :goto_0

    :cond_4
    move v0, v1

    goto :goto_2
.end method
